package com.eckey.lab.service;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

/**
 * @Author: Marinc
 * @CreateTime: 2023-12-13  09:46
 * @Description: TODO
 * @Version: 1.0
 */
@LocalTCC
public interface TCCUserService {

    @TwoPhaseBusinessAction(name = "deduct", commitMethod = "confirm", rollbackMethod = "cancel")
    void deduct(Integer userId, int money);


    boolean confirm(BusinessActionContext businessActionContext);


    boolean cancel(BusinessActionContext businessActionContext);

}
